import { NgModule } from '@angular/core';
import { CommonModule, DatePipe } from '@angular/common';
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { DragDropModule } from '@angular/cdk/drag-drop';
import { AlainThemeModule } from '@delon/theme';
import { DelonABCModule } from '@delon/abc';
// 组件
import { IndexKmnDetailComponent } from '../routes/main/index/detail/index.component.detail';

import { MenuTabComponent } from '../layout/components/menuTab.component';
import { HeaderComponent } from '../layout/components/header.component';
import { YearFilterComponent } from '../layout/components/yearFilter.component';
import { EquipmentComponent } from '../layout/components/equipment.component';
import { YearCalendarComponent } from '../layout/components/yearCalendar.component';
import { MaintenanceComponent } from '../layout/components/maintenance.component';
import { FarmReactComponent } from '../layout/components/farmreact.component';
import { TableCheckPageComponent } from '../layout/components/tableCheckPage.component';
import { GoodsSearchComponent } from '../layout/components/goods-search.component';
import { DateFilterComponent } from '../layout/components/date-filter.component';

import { AddYearComponent } from '../routes/main/yearwork/addyear.component';
import { OperateYearComponent } from '../routes/main/yearwork/operate.component';
import { StstusYearComponent } from '../routes/main/yearwork/statusyear.component';
import { AddWorkComponent } from '../routes/main/yearwork/addwork.component';
import { PetitionOperaModalComponent } from '../routes/main/petitionView/operaModal.component';

import { ElectricalnmlComponent } from '../routes/main/control/components/electricalnml.component';
import { ElectricalnmlTableComponent } from '../routes/main/control/components/electricalnmlTable.component';
import { ControlprocessComponent } from '../routes/main/control/components/process.component';
import { ControlintelligentComponent } from '../routes/main/control/components/intelligent.component';
import { ControlczjyComponent } from '../routes/main/control/components/czjy.component';
import { MaskIframeComponent } from '../routes/main/control/components/maskIframe.component';
// 第三方组件
import { NgZorroAntdModule } from 'ng-zorro-antd';
import { EditorModule } from '@tinymce/tinymce-angular';

const THIRDMODULES = [
  NgZorroAntdModule,
  EditorModule
];

const COMPONENTS = [
  HeaderComponent,
  YearFilterComponent,
  EquipmentComponent,
  YearCalendarComponent,
  MaintenanceComponent,
  ElectricalnmlComponent,
  ElectricalnmlTableComponent,
  ControlprocessComponent,
  ControlintelligentComponent,
  ControlczjyComponent,
  FarmReactComponent,
  IndexKmnDetailComponent,
  MenuTabComponent,
  AddYearComponent,
  OperateYearComponent,
  StstusYearComponent,
  AddWorkComponent,
  MaskIframeComponent,
  TableCheckPageComponent,
  PetitionOperaModalComponent,
  // 组件?页面?
  DateFilterComponent,
  GoodsSearchComponent
];
const DIRECTIVES = [];

// endregion
@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    RouterModule,
    ReactiveFormsModule,
    DragDropModule,
    AlainThemeModule.forChild(),
    DelonABCModule,
    ...THIRDMODULES,
  ],
  declarations: [
    // your components
    ...COMPONENTS,
    ...DIRECTIVES
  ],
  exports: [
    CommonModule,
    FormsModule,
    ReactiveFormsModule,
    RouterModule,
    AlainThemeModule,
    DelonABCModule,
    ...THIRDMODULES,
    // your components
    ...COMPONENTS,
    ...DIRECTIVES
  ],
  providers: [DatePipe]
})
export class SharedModule { }
